<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <input type="text" style="width: 800px; height: 200px; font-size: 180px;">
    <script>
        /* 
            键盘事件：  
                1. keyup: 键盘弹起触发。
                2. keydown: 键盘按下，一直触发
                3. keypress: 键盘按下，一直触发
                4. keypress: 不能触发功能键。
        */
        document.addEventListener('keyup',function (){
            console.log('-----------keyup-------------');
        });
        document.addEventListener('keydown',function (){
            console.log('-----------keydown-------------');
        });
        document.addEventListener('keypress',function (){
            console.log('-----------keypress-------------');
        });

    </script>
</body>

</html>